package com.Ajava1704.for设计模式.for动态代理.CGLIB;

/**
 * 作者: LCG
 * 日期: 2020/2/14 09:10
 * 描述:
 */
public class ForTest002 {

    public static void main(String[] args) {
        //为接口创建代理实现
        /*ForMyMethodInterceptor<ForCGLIBInterface> forMyMethodInterceptor=new ForMyMethodInterceptor<>();
        ForCGLIBInterface proxyObject = forMyMethodInterceptor.getProxyObject(ForCGLIBInterface.class);
        System.out.println(proxyObject.test());*/

        //为类创建代理实现

        ForMyMethodInterceptor2<TestObjectImpl> forMyMethodInterceptor2=new ForMyMethodInterceptor2<>(new TestObjectImpl());
        TestObjectImpl objectProxy = forMyMethodInterceptor2.getObjectProxy(TestObjectImpl.class);

        System.out.println(objectProxy.test("hello world"));
    }

}
